package com.person.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.person.entity.Book;
import com.person.entity.Person;
import com.person.entity.Notes;
import com.person.entity.Student;

import com.person.dao.BookDao;
import com.person.dao.PersonDao;
import com.person.dao.NotesDao;
import com.person.dao.StudentDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bookDaoConfig;
    private final DaoConfig personDaoConfig;
    private final DaoConfig notesDaoConfig;
    private final DaoConfig studentDaoConfig;

    private final BookDao bookDao;
    private final PersonDao personDao;
    private final NotesDao notesDao;
    private final StudentDao studentDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bookDaoConfig = daoConfigMap.get(BookDao.class).clone();
        bookDaoConfig.initIdentityScope(type);

        personDaoConfig = daoConfigMap.get(PersonDao.class).clone();
        personDaoConfig.initIdentityScope(type);

        notesDaoConfig = daoConfigMap.get(NotesDao.class).clone();
        notesDaoConfig.initIdentityScope(type);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        bookDao = new BookDao(bookDaoConfig, this);
        personDao = new PersonDao(personDaoConfig, this);
        notesDao = new NotesDao(notesDaoConfig, this);
        studentDao = new StudentDao(studentDaoConfig, this);

        registerDao(Book.class, bookDao);
        registerDao(Person.class, personDao);
        registerDao(Notes.class, notesDao);
        registerDao(Student.class, studentDao);
    }
    
    public void clear() {
        bookDaoConfig.clearIdentityScope();
        personDaoConfig.clearIdentityScope();
        notesDaoConfig.clearIdentityScope();
        studentDaoConfig.clearIdentityScope();
    }

    public BookDao getBookDao() {
        return bookDao;
    }

    public PersonDao getPersonDao() {
        return personDao;
    }

    public NotesDao getNotesDao() {
        return notesDao;
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

}
